/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  							 script_set_variable.cpp

	$Header: /heroes4/script_set_variable.cpp $

	$NoKeywords: $

 ************************************************************************/

// kill the 255+ character identifier warning.  Templates tend to exceed that easily.
#include "precompiled.h"
#pragma warning( disable: 4786 )

#include "script_set_variable.h"
#include "adventure_map.h"

void t_script_set_numeric_variable::execute(t_script_context_hero const& context) const
{
	t_expression::t_result result = get_expression().evaluate(context);

	context.map->set_numeric_script_variable(get_variable_name(), result);
}

void t_script_set_numeric_variable::execute(t_script_context_town const& context) const
{
	t_expression::t_result result = get_expression().evaluate(context);

	context.map->set_numeric_script_variable(get_variable_name(), result);
}

void t_script_set_numeric_variable::execute(t_script_context_object const& context) const
{
	t_expression::t_result result = get_expression().evaluate(context);

	context.map->set_numeric_script_variable(get_variable_name(), result);
}

void t_script_set_numeric_variable::execute(t_script_context_army const& context) const
{
	t_expression::t_result result = get_expression().evaluate(context);

	context.map->set_numeric_script_variable(get_variable_name(), result);
}

void t_script_set_numeric_variable::execute(t_script_context_global const& context) const
{
	t_expression::t_result result = get_expression().evaluate(context);

	context.map->set_numeric_script_variable(get_variable_name(), result);
}

// -----------------------------

void t_script_set_boolean_variable::execute(t_script_context_hero const& context) const
{
	t_expression::t_result result = get_expression().evaluate(context);

	context.map->set_boolean_script_variable(get_variable_name(), result);
}

void t_script_set_boolean_variable::execute(t_script_context_town const& context) const
{
	t_expression::t_result result = get_expression().evaluate(context);

	context.map->set_boolean_script_variable(get_variable_name(), result);
}

void t_script_set_boolean_variable::execute(t_script_context_object const& context) const
{
	t_expression::t_result result = get_expression().evaluate(context);

	context.map->set_boolean_script_variable(get_variable_name(), result);
}

void t_script_set_boolean_variable::execute(t_script_context_army const& context) const
{
	t_expression::t_result result = get_expression().evaluate(context);

	context.map->set_boolean_script_variable(get_variable_name(), result);
}

void t_script_set_boolean_variable::execute(t_script_context_global const& context) const
{
	t_expression::t_result result = get_expression().evaluate(context);

	context.map->set_boolean_script_variable(get_variable_name(), result);
}




